<?php
	require 'php/Session.php';
	Session::start();
	if(Session::get("cobach_user")){
?>
		<script language="javascript">
			location.href="php/principal.php";
		</script>
<?php
	}else if(Session::get("cobach_admin")){
?>
		<script language="javascript">
			location.href="php/principal_admin.php";
		</script>
<?php
	}else{	
?>

<!------------------------------------------------------------------------------------------------------------------------>

<html>
	<head>
    	<meta charset="utf-8" />
        <title>SCI Cobach Campeche</title>
    <link href="styles/login.css" rel="stylesheet" type="text/css">
    <link href="styles/main.css" rel="stylesheet" type="text/css">
	</head>
<body class="container">
        <nav>
        	<img src="resourses/logo_cobach.jpg" height="40">
        	<ul>
           	  <li><a href="#">Inicio</a></li>
                <li><a href="#">Consultas</a></li>
                <li><a href="#">Reportes</a></li>               
          </ul>
</nav>
		<div id="content">
            <div id="login">
            	<form action="php/validar_usuario.php" method="post">
                	<input name="username" type="text" id="username" placeholder="Usuario" />
                    <input name="password" type="password" id="password" placeholder="Contraseña" /><br/>
                    <button type="submit" name="Submit">Acceder</button>
                </form>
            </div>
        </div>
        <footer>
        	<p>Sistema de Control Infomatico | Cobach Campeche</p>
        </footer>
</body>
</html>

<!------------------------------------------------------------------------------------------------------------------------>

<?php
	}
?>